<!doctype html>
<html  class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>主数据管理平台 </title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<link rel="shortcut icon" href="common/images/title.png" type="image/x-icon">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="./common/css/login.css">
    <script type="text/javascript" src="./common/js/public.js"></script>
    <script type="text/javascript" src="./common/js/publicUtils.js"></script>
</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">主数据管理平台</div>
        <div id="darkbannerwrap"></div>
        
        <div class="layui-form" >
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登 录" lay-submit class="submit"  lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </div>
    </div>

    <script>
        $(function  () {
        	if(window!=top){
        		top.location.href = window.location;
        	}
        	
            layui.use('form', function(){
              var form = layui.form;

              form.on('submit(login)', function(data){

                  loginSystem();
                  return false;
                
              });
            });

            document.onkeydown =login;
            function login(){
                if(event.keyCode ==13){
                    loginSystem();
                }
            }

        })
        function loginSystem(){
            var username = $("input[name=username]").val();
            var password = $("input[name=password]").val();
            if(username.length<0){
                layerror("用户名不能为空！");
            }
            if(password.length<0){
                layerror("密码不能为空！");
            }
            publicAjax(null,'login/loginSystem',{'loginName':username,'password':hex_md5(password)},false,null,function(r){
                if(r.code==2000){
                    $(".submit").val("登 录 中");
                    delayLoad(function(){
                        updateData("Authorization",r.data);
                        updateData("cacheflag",1);
                        location.href='./index.html';
                    },500)
                }else{
                    layerror(r.msg?r.msg:"登录失败！");
                }
            })
        }
        

    </script>
    <!-- 底部结束 -->
</body>
</html>